Optimal. Leaf size=200 \[ -\frac {\left (a^2 (2-m)+b^2 (1-m)\right ) \sin (c+d x) \sec ^{m-3}(c+d x) \, _2F_1\left (\frac {1}{2},\frac {3-m}{2};\frac {5-m}{2};\cos ^2(c+d x)\right )}{d (1-m) (3-m) \sqrt {\sin ^2(c+d x)}}-\frac {a^2 \sin (c+d x) \sec ^{m-1}(c+d x)}{d (1-m)}-\frac {2 a b \sin (c+d x) \sec ^{m-2}(c+d x) \, _2F_1\left (\frac {1}{2},\frac {2-m}{2};\frac {4-m}{2};\cos ^2(c+d x)\right )}{d (2-m) \sqrt {\sin ^2(c+d x)}} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.19, antiderivative size = 200, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 5, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.238, Rules used = {3238, 3788, 3772, 2643, 4046} \[ -\frac {\left (a^2 (2-m)+b^2 (1-m)\right ) \sin (c+d x) \sec ^{m-3}(c+d x) \, _2F_1\left (\frac {1}{2},\frac {3-m}{2};\frac {5-m}{2};\cos ^2(c+d x)\right )}{d (1-m) (3-m) \sqrt {\sin ^2(c+d x)}}-\frac {a^2 \sin (c+d x) \sec ^{m-1}(c+d x)}{d (1-m)}-\frac {2 a b \sin (c+d x) \sec ^{m-2}(c+d x) \, _2F_1\left (\frac {1}{2},\frac {2-m}{2};\frac {4-m}{2};\cos ^2(c+d x)\right )}{d (2-m) \sqrt {\sin ^2(c+d x)}} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2643
Rule 3238
Rule 3772
Rule 3788
Rule 4046
Rubi steps
\begin {align*} \int (a+b \cos (c+d x))^2 \sec ^m(c+d x) \, dx &=\int \sec ^{-2+m}(c+d x) (b+a \sec (c+d x))^2 \, dx\\ &=(2 a b) \int \sec ^{-1+m}(c+d x) \, dx+\int \sec ^{-2+m}(c+d x) \left (b^2+a^2 \sec ^2(c+d x)\right ) \, dx\\ &=-\frac {a^2 \sec ^{-1+m}(c+d x) \sin (c+d x)}{d (1-m)}+\left (b^2+\frac {a^2 (2-m)}{1-m}\right ) \int \sec ^{-2+m}(c+d x) \, dx+\left (2 a b \cos ^m(c+d x) \sec ^m(c+d x)\right ) \int \cos ^{1-m}(c+d x) \, dx\\ &=-\frac {a^2 \sec ^{-1+m}(c+d x) \sin (c+d x)}{d (1-m)}-\frac {2 a b \, _2F_1\left (\frac {1}{2},\frac {2-m}{2};\frac {4-m}{2};\cos ^2(c+d x)\right ) \sec ^{-2+m}(c+d x) \sin (c+d x)}{d (2-m) \sqrt {\sin ^2(c+d x)}}+\left (\left (b^2+\frac {a^2 (2-m)}{1-m}\right ) \cos ^m(c+d x) \sec ^m(c+d x)\right ) \int \cos ^{2-m}(c+d x) \, dx\\ &=-\frac {a^2 \sec ^{-1+m}(c+d x) \sin (c+d x)}{d (1-m)}-\frac {\left (b^2+\frac {a^2 (2-m)}{1-m}\right ) \, _2F_1\left (\frac {1}{2},\frac {3-m}{2};\frac {5-m}{2};\cos ^2(c+d x)\right ) \sec ^{-3+m}(c+d x) \sin (c+d x)}{d (3-m) \sqrt {\sin ^2(c+d x)}}-\frac {2 a b \, _2F_1\left (\frac {1}{2},\frac {2-m}{2};\frac {4-m}{2};\cos ^2(c+d x)\right ) \sec ^{-2+m}(c+d x) \sin (c+d x)}{d (2-m) \sqrt {\sin ^2(c+d x)}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.34, size = 159, normalized size = 0.80 \[ \frac {\sqrt {-\tan ^2(c+d x)} \csc (c+d x) \sec ^{m-3}(c+d x) \left (a (m-2) \sec ^2(c+d x) \left (a (m-1) \, _2F_1\left (\frac {1}{2},\frac {m}{2};\frac {m+2}{2};\sec ^2(c+d x)\right )+2 b m \cos (c+d x) \, _2F_1\left (\frac {1}{2},\frac {m-1}{2};\frac {m+1}{2};\sec ^2(c+d x)\right )\right )+b^2 (m-1) m \, _2F_1\left (\frac {1}{2},\frac {m-2}{2};\frac {m}{2};\sec ^2(c+d x)\right )\right )}{d (m-2) (m-1) m} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [F] time = 1.89, size = 0, normalized size = 0.00 \[ {\rm integral}\left ({\left (b^{2} \cos \left (d x + c\right )^{2} + 2 \, a b \cos \left (d x + c\right ) + a^{2}\right )} \sec \left (d x + c\right )^{m}, x\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int {\left (b \cos \left (d x + c\right ) + a\right )}^{2} \sec \left (d x + c\right )^{m}\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [F] time = 1.30, size = 0, normalized size = 0.00 \[ \int \left (a +b \cos \left (d x +c \right )\right )^{2} \left (\sec ^{m}\left (d x +c \right )\right )\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int {\left (b \cos \left (d x + c\right ) + a\right )}^{2} \sec \left (d x + c\right )^{m}\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [F] time = 0.00, size = -1, normalized size = -0.00 \[ \int {\left (\frac {1}{\cos \left (c+d\,x\right )}\right )}^m\,{\left (a+b\,\cos \left (c+d\,x\right )\right )}^2 \,d x \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (a + b \cos {\left (c + d x \right )}\right )^{2} \sec ^{m}{\left (c + d x \right )}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________